package com.wisnews.mapper.sr;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.wisnews.pojo.sr.entity.PostInfo;
import com.wisnews.pojo.sr.vo.PostVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yuyd
 * @since 2021-03-19
 */
@Mapper
public interface PostInfoMapper extends BaseMapper<PostInfo> {

    @Select(" SELECT a.`post_id`, a.`post_content`, a.`post_data_time`, a.`post_like`, b.`user_name` FROM" +
            " `t_sr_post_info` a LEFT JOIN `t_sr_member` b ON a.`post_member_id` = b.`user_id` ${ew.customSqlSegment}")
    IPage<PostVO> postJoinMemberList(@Param(Constants.WRAPPER) Wrapper<PostVO> postLambdaQueryWrapper, IPage page);
}
